package com.anyonavinfo.cpaddemo.utils;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

import com.anyonavinfo.cpaddemo.Application;

/**
 * Created by ZuiC on 2017/2/7.
 */

public class AppManagerUtils {

    private static AppManagerUtils INSTANCE = null;
    private Context mContext;


    public static AppManagerUtils getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new AppManagerUtils();
        }
        return INSTANCE;
    }

    private AppManagerUtils(){
        mContext = Application.getContextObject();
    }

    public void launchActivity(String packageName) {
        PackageManager packageManager = mContext.getPackageManager();
        Intent appIntent = packageManager.getLaunchIntentForPackage(packageName);
        mContext.startActivity(appIntent);
    }

}
